﻿using Sidewinder.Core.Interfaces.Entities;
using Wolfpack.Core.Configuration;
using Wolfpack.Core.Interfaces.Entities;
using Wolfpack.Core;
using Wolfpack.Core.Notification.Filters.Request;

namespace Wolfpack.Contrib.Deployment
{
    public class DeploymentPublisherConfigurationDiscovery : PluginDiscoveryBase<DeploymentConfig, DeploymentPublisher>
    {
        protected override DeploymentConfig GetConfiguration()
        {
            return new DeploymentConfig
                       {
                           ConflictResolution = ConflictResolutionTypes.Overwrite,
                           DownloadFolder = @"_deploy\demo",
                           Enabled = true,
                           Feed = "",
                           FriendlyId = "CHANGEME!",
                           NotificationMode = AlwaysPublishNotificationFilter.FilterName,
                           PackageId = "Name of NuGet package to download",
                           TargetHealthCheckName = "FriendlyId of trigger health check"
                       };
        }

        protected override void Configure(ConfigurationEntry entry)
        {
            entry.Name = "DeploymentPublisher";
            entry.Description = "This publish reacts to a trigger message (usually from the NuGet check) and will " +
                "download the updated NuGet package from the feed to a folder you specify.";
            entry.Tags.AddIfMissing(SpecialTags.PUBLISHER, "Deployment");
        }
    }
}